package cn.cumulomq.service;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;

import cn.cumulomq.dao.MessageCategoryDao;
import cn.cumulomq.db.ConfigDB;
import cn.cumulomq.entity.MessageCategory;

/**
 * 存储查询报文类型和关联正则表达式
 * @author maxuedong
 *
 */
public class MessageCategoryService {
	private Logger logger = Logger.getLogger(MessageCategoryService.class);
	public List<MessageCategory> list(MessageCategory messageCategory){
		List<MessageCategory> res = new ArrayList<MessageCategory>();
		try{
			SqlSession session = ConfigDB.getSessionFactory().openSession();
			MessageCategoryDao messageCategoryDao = session.getMapper(MessageCategoryDao.class);
			res = messageCategoryDao.list(messageCategory);
			session.close();
		}catch(Exception e){
			logger.error(e);
		}
		return res;
	}
}
